import request from '@/utils/request'

// 图库列表
export const galleryListApi = (page:number,limit?:number) => request.get(`image_class/${page}`,{params:{limit}})

// 指定分类下的图片列表
export const galleryClassListApi = (id:number,page:number = 1,limit?:number) => request.get(`image_class/${id}/image/${page}`,{params:{limit}})

// 增加图库分类
export const addGalleryClassApi = (name:string,order:number) => request.post('image_class',{name,order})

// 修改图库分类
export const updateGalleryClassApi = (id:number,name:string,order:number) => request.post(`image_class/`+ id ,{name,order})

// 删除图库分类
export const removeGalleryClassApi = (id:number) => request.post(`image_class/${id}/delete`)

// 图片上传
export const imageUploadApi = '/api/image/upload'

// 删除图片
export const removeImageApi = (ids:any) => request.post('image/delete_all',{ids})

// 修改图片名称
export const updateImageNameApi = (id:number,name:string) => request.post(`image/${id}`,{name})